package com.kevin.learn.c.适配器模式.b.对象适配器;

/**
 * 适配器类
 */
public class VoltageAdapter extends Voltage220V implements IVoltage5V {

    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int desV = 0;
        if (null != voltage220V) {
            int srcV = output220V();
            desV = srcV / 44;
        }
        return desV;
    }
}
